package com.jhopesoft.business.sales.entity;
// default package

// Generated 2018-3-6 16:54:10 by Hibernate Tools 5.2.6.Final

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

import org.hibernate.annotations.GenericGenerator;

import com.jhopesoft.framework.dao.entity.system.FPersonnel;

/**
 * SlOrder generated by hbm2java
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "sl_order", uniqueConstraints = @UniqueConstraint(columnNames = "code_"))
public class SlOrder implements java.io.Serializable {

	private String id;
	private FPersonnel FPersonnel;
	private SlCity slCityByTocityid;
	private SlCity slCityByFromcityid;
	private SlCustomer slCustomer;
	private String code;
	private Date orderDate;
	private BigDecimal amount;
	private BigDecimal alreadyAmount;
	private Set<SlOrderdetail> slOrderdetails = new HashSet<SlOrderdetail>(0);

	public SlOrder() {
	}

	public SlOrder(String id, FPersonnel FPersonnel, SlCity slCityByTocityid, SlCity slCityByFromcityid,
			SlCustomer slCustomer, String code, Date orderDate) {
		this.id = id;
		this.FPersonnel = FPersonnel;
		this.slCityByTocityid = slCityByTocityid;
		this.slCityByFromcityid = slCityByFromcityid;
		this.slCustomer = slCustomer;
		this.code = code;
		this.orderDate = orderDate;
	}

	public SlOrder(String id, FPersonnel FPersonnel, SlCity slCityByTocityid, SlCity slCityByFromcityid,
			SlCustomer slCustomer, String code, Date orderDate, BigDecimal amount, BigDecimal alreadyAmount,
			Set<SlOrderdetail> slOrderdetails) {
		this.id = id;
		this.FPersonnel = FPersonnel;
		this.slCityByTocityid = slCityByTocityid;
		this.slCityByFromcityid = slCityByFromcityid;
		this.slCustomer = slCustomer;
		this.code = code;
		this.orderDate = orderDate;
		this.amount = amount;
		this.alreadyAmount = alreadyAmount;
		this.slOrderdetails = slOrderdetails;
	}

	@Id
  @GeneratedValue(generator = "generator")
  @GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Column(name = "id_", unique = true, nullable = false, length = 40)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "personnelid_", nullable = false)
	public FPersonnel getFPersonnel() {
		return this.FPersonnel;
	}

	public void setFPersonnel(FPersonnel FPersonnel) {
		this.FPersonnel = FPersonnel;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "tocityid_", nullable = false)
	public SlCity getSlCityByTocityid() {
		return this.slCityByTocityid;
	}

	public void setSlCityByTocityid(SlCity slCityByTocityid) {
		this.slCityByTocityid = slCityByTocityid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "fromcityid_", nullable = false)
	public SlCity getSlCityByFromcityid() {
		return this.slCityByFromcityid;
	}

	public void setSlCityByFromcityid(SlCity slCityByFromcityid) {
		this.slCityByFromcityid = slCityByFromcityid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "customerid_", nullable = false)
	public SlCustomer getSlCustomer() {
		return this.slCustomer;
	}

	public void setSlCustomer(SlCustomer slCustomer) {
		this.slCustomer = slCustomer;
	}

	@Column(name = "code_", unique = true, nullable = false, length = 50)
	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "order_date_", nullable = false, length = 10)
	public Date getOrderDate() {
		return this.orderDate;
	}

	public void setOrderDate(Date orderDate) {
		this.orderDate = orderDate;
	}

	@Column(name = "amount_", precision = 12)
	public BigDecimal getAmount() {
		return this.amount;
	}

	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}

	@Column(name = "already_amount_", precision = 12)
	public BigDecimal getAlreadyAmount() {
		return this.alreadyAmount;
	}

	public void setAlreadyAmount(BigDecimal alreadyAmount) {
		this.alreadyAmount = alreadyAmount;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "slOrder")
	public Set<SlOrderdetail> getSlOrderdetails() {
		return this.slOrderdetails;
	}

	public void setSlOrderdetails(Set<SlOrderdetail> slOrderdetails) {
		this.slOrderdetails = slOrderdetails;
	}

}
